#include "NoFlash2.h"

NoFlash2 g_pNoFlash2;

void NoFlash2::Init()
{
	Active = true;
	g_pFlashEffect  = g_pInterfaces.g_pMaterialSystem->FindMaterial("effects/flashbang", "ClientEffect textures", true, NULL);
	g_pFlashOverlay = g_pInterfaces.g_pMaterialSystem->FindMaterial("effects/flashbang_white", "ClientEffect textures", true, NULL);
}

void NoFlash2::SetActive(bool bActive)
{
	Active = bActive;
}

void NoFlash2::Enable()
{
	Active = true;
}

void NoFlash2::Disable()
{
	Active = false;
}

void NoFlash2::Compute()
{
	if(Active)
	{
		g_pFlashEffect->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
		g_pFlashOverlay->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, true);
	}
	else
	{
		g_pFlashEffect->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, false);
		g_pFlashOverlay->SetMaterialVarFlag(MATERIAL_VAR_NO_DRAW, false);
	}
}